home *** CD-ROM | disk | FTP | other *** search
/ Creative Computers / Creative Computers CD-ROM, Volume 1 (Legendary Design Technologies, Inc.)(1994).iso / shareware / intuition / yak_1.57 / source / popup.c < prev    next >
C/C++ Source or Header  |  1994-11-17  |  24KB  |  804 lines

  1.  
  2. /*
  3.  *  Source machine generated by GadToolsBox V2.0b
  4.  *  which is (c) Copyright 1991-1993 Jaba Development
  5.  *
  6.  *  GUI Designed by : Martin W Scott and Gaël Marziou
  7.  */
  8.  
  9.  
  10.  
  11.  
  12. #include <exec/types.h>
  13. #include <intuition/intuition.h>
  14. #include <intuition/classes.h>
  15. #include <intuition/classusr.h>
  16. #include <intuition/imageclass.h>
  17. #include <intuition/gadgetclass.h>
  18. #include <intuition/intuitionbase.h>
  19. #include <libraries/gadtools.h>
  20. #include <graphics/displayinfo.h>
  21. #include <graphics/gfxbase.h>
  22. #include <proto/exec.h>
  23. #include <proto/intuition.h>
  24. #include <proto/gadtools.h>
  25. #include <proto/graphics.h>
  26. #include <proto/locale.h>
  27. #include <proto/utility.h>
  28. #include <string.h>
  29. #include <pragmas/exec_pragmas.h>
  30. #include <pragmas/intuition_pragmas.h>
  31. #include <pragmas/gadtools_pragmas.h>
  32. #include <pragmas/graphics_pragmas.h>
  33. #include <pragmas/utility_pragmas.h>
  34.  
  35.  
  36. #include "version.h"
  37. #include "yak.h"
  38. #include "popup.h"
  39. #include "popup_fix.h"  /**** ADDED */
  40.  
  41. #define CATCOMP_NUMBERS
  42. #include "yak_locale_strings.h"
  43. extern char *getString(ULONG MsgID); 
  44.  
  45. #ifdef BETA_VERSION
  46. static UBYTE DisplayBetaRequester = TRUE;
  47. #endif
  48.  
  49.  
  50. extern struct Catalog    *Catalog;
  51.  
  52. struct Screen         *Scr = NULL;
  53. UBYTE                 *PubScreenName;
  54. APTR                   VisualInfo = NULL;
  55. struct Window         *HelpWnd = NULL;
  56. struct Window         *HotKeyWnd = NULL;
  57. struct Window         *MiscWnd = NULL;
  58. struct Gadget         *HelpGList = NULL;
  59. struct Gadget         *HotKeyGList = NULL;
  60. struct Gadget         *MiscGList = NULL;
  61. struct Menu           *HelpMenus = NULL;
  62. UWORD                  HelpZoom[4];
  63. struct Gadget         *HelpGadgets[Help_CNT];
  64. struct Gadget         *HotKeyGadgets[HotKey_CNT];
  65. struct Gadget         *MiscGadgets[Misc_CNT];
  66. UWORD                  HelpLeft = 0;
  67. UWORD                  HelpWidth = 632;
  68. UWORD                  HelpHeight = 181;
  69. UWORD                  HotKeyLeft = 0;
  70. UWORD                  HotKeyWidth = 455;
  71. UWORD                  HotKeyHeight = 150;
  72. UWORD                  MiscLeft = 0;
  73. UWORD                  MiscWidth = 400;
  74. UWORD                  MiscHeight = 65;
  75. UWORD                    WindowTop;
  76. UBYTE                 *HelpWdt = NULL;
  77. UBYTE                 *HotKeyWdt = NULL;
  78. UBYTE                 *MiscWdt = NULL;
  79. struct TextAttr       *Font, Attr;
  80. UWORD                  FontX, FontY; 
  81. UWORD                  OffX, OffY;
  82.  
  83. static BOOL GUIFirstOpening = TRUE;
  84.  
  85. UBYTE *MBMethod0Labels[4];
  86.  
  87. void InitMBMethod0Labels (void)
  88. {
  89.     MBMethod0Labels[0] = getString(NONE_STRING);
  90.     MBMethod0Labels[1] = getString(SPRITES_STRING);
  91.     MBMethod0Labels[2] = getString(COPPER_STRING);
  92.     MBMethod0Labels[3] = NULL ;
  93. }
  94.  
  95. UBYTE *Options1Labels[4];
  96.  
  97. void InitOptions1Label (void)
  98. {
  99.     Options1Labels[0] = getString(NO_SCREEN_CHANGE_STRING);
  100.     Options1Labels[1] = getString(WORKBENCH_TO_FRONT_STRING);
  101.     Options1Labels[2] = getString(DEFAULT_PUBSCR_TO_FRONT_STRING);
  102.     Options1Labels[3] = NULL ;
  103. }
  104.  
  105.  
  106. extern struct MinList Actions1List;
  107.  
  108. struct Node Actions1Nodes[] = {
  109.     &Actions1Nodes[1], ( struct Node * )&Actions1List.mlh_Head, 0, 0, NULL,
  110.     &Actions1Nodes[2], &Actions1Nodes[0], 0, 0, NULL,
  111.     &Actions1Nodes[3], &Actions1Nodes[1], 0, 0, NULL,
  112.     &Actions1Nodes[4], &Actions1Nodes[2], 0, 0, NULL,
  113.     &Actions1Nodes[5], &Actions1Nodes[3], 0, 0, NULL,
  114.     &Actions1Nodes[6], &Actions1Nodes[5], 0, 0, NULL,
  115.     &Actions1Nodes[7], &Actions1Nodes[6], 0, 0, NULL,
  116.     &Actions1Nodes[8], &Actions1Nodes[7], 0, 0, NULL,
  117.     &Actions1Nodes[9], &Actions1Nodes[8], 0, 0, NULL,
  118.     &Actions1Nodes[10], &Actions1Nodes[9], 0, 0, NULL,
  119.     &Actions1Nodes[11], &Actions1Nodes[10], 0, 0, NULL,
  120.     &Actions1Nodes[12], &Actions1Nodes[11], 0, 0, NULL,
  121.     &Actions1Nodes[13], &Actions1Nodes[12], 0, 0, NULL,
  122.     &Actions1Nodes[14], &Actions1Nodes[13], 0, 0, NULL,
  123.     &Actions1Nodes[15], &Actions1Nodes[14], 0, 0, NULL,
  124.     ( struct Node * )&Actions1List.mlh_Tail, &Actions1Nodes[14], 0, 0, NULL };
  125.  
  126. void InitActions1Nodes (void)
  127. {
  128.     Actions1Nodes[0].ln_Name  = getString(DOS_Command_ACT);
  129.     Actions1Nodes[1].ln_Name  = getString(Close_Window_ACT);
  130.     Actions1Nodes[2].ln_Name  = getString(Zip_Window_ACT);
  131.     Actions1Nodes[3].ln_Name  = getString(Shrink_Window_ACT);
  132.     Actions1Nodes[4].ln_Name  = getString(Expand_Window_ACT);
  133.     Actions1Nodes[5].ln_Name  = getString(Cycle_Windows_ACT);
  134.     Actions1Nodes[6].ln_Name  = getString(Open_Palette_ACT);
  135.     Actions1Nodes[7].ln_Name  = getString(Screen_to_Front_ACT);
  136.     Actions1Nodes[8].ln_Name  = getString(Screen_to_Back_ACT);
  137.     Actions1Nodes[9].ln_Name  = getString(Activate_Workbench_ACT);
  138.     Actions1Nodes[10].ln_Name  = getString(Centre_Screen_ACT);
  139.     Actions1Nodes[11].ln_Name = getString(Blank_Display_ACT);
  140.     Actions1Nodes[12].ln_Name = getString(Insert_Text_ACT);
  141.     Actions1Nodes[13].ln_Name = getString(Insert_Date_ACT);
  142.     Actions1Nodes[14].ln_Name = getString(Show_Yak_Interface_ACT);
  143.     Actions1Nodes[15].ln_Name  = getString(Back_Cycle_Windows_ACT);
  144. }
  145.  
  146. struct MinList Actions1List = {
  147.     ( struct MinNode * )&Actions1Nodes[0], 
  148.     ( struct MinNode * )NULL, 
  149.     ( struct MinNode * )&Actions1Nodes[14] };
  150.  
  151. struct IntuiText HelpIText[] = {
  152.     2, 0, JAM1,40, 11, NULL, NULL, NULL,
  153.     2, 0, JAM1,84, 93, NULL, NULL, NULL,
  154.     2, 0, JAM1,488, 85, NULL, NULL, NULL };
  155.  
  156.  
  157. #define Help_TNUM 3
  158.  
  159. void InitHelpIText (void)
  160. {
  161.    HelpIText[0].IText = getString(TOGGLES_STRING);
  162.    HelpIText[1].IText = getString(INCLUSION_PATTERNS_STRING);
  163.    HelpIText[2].IText = getString(TIMEOUT_STRING);
  164. }
  165.  
  166. struct NewMenu HelpNewMenu[] = {
  167.     NM_TITLE, NULL, NULL, 0, NULL, NULL,
  168.     NM_ITEM, NULL, NULL, 0, 0L, NULL,
  169.     NM_ITEM, NULL, NULL, 0, 0L, NULL,
  170.     NM_ITEM, NULL, NULL, 0, 0L, NULL,
  171.     NM_ITEM, NULL, NULL, 0, 0L, NULL,
  172.     NM_ITEM, NULL, NULL, 0, NULL, NULL,
  173.     NM_SUB, NULL, NULL, 0, 0L, NULL,
  174.     NM_SUB, NULL, NULL, 0, 0L, NULL,
  175.     NM_SUB, NULL, NULL, 0, 0L, NULL,
  176.     NM_SUB, NULL, NULL, 0, 0L, NULL,
  177.     NM_SUB, NULL, NULL, 0, 0L, NULL,    
  178.     NM_END, NULL, NULL, 0, 0L, NULL };
  179.  
  180. void InitHelpNewMenu (void)
  181. {
  182.     HelpNewMenu[0].nm_Label   = (STRPTR)getString(PROJECT_STRING);
  183.     HelpNewMenu[1].nm_Label   = (STRPTR)getString(LOAD_SETTINGS_STRING);
  184.     HelpNewMenu[1].nm_CommKey = (STRPTR)getString(LOAD_SHORTCUT);
  185.     HelpNewMenu[2].nm_Label   = (STRPTR)getString(SAVE_SETTINGS_STRING);
  186.     HelpNewMenu[2].nm_CommKey = (STRPTR)getString(SAVE_SHORTCUT);
  187.     HelpNewMenu[3].nm_Label   = (STRPTR)getString(HIDE_WINDOW_STRING);
  188.     HelpNewMenu[3].nm_CommKey = (STRPTR)getString(HIDE_SHORTCUT);
  189.     HelpNewMenu[4].nm_Label   = (STRPTR)getString(QUIT_STRING);
  190.     HelpNewMenu[4].nm_CommKey = (STRPTR)getString(QUIT_SHORTCUT);
  191.     HelpNewMenu[5].nm_Label   = (STRPTR)getString(Credits_STRING);
  192.     HelpNewMenu[6].nm_Label   = (STRPTR)getString(Credits_Line1_STRING);
  193.     HelpNewMenu[7].nm_Label   = (STRPTR)getString(Credits_Line2_STRING);
  194.     HelpNewMenu[8].nm_Label   = (STRPTR)getString(Credits_Line3_STRING);
  195.     HelpNewMenu[9].nm_Label   = (STRPTR)getString(Credits_Line4_STRING);
  196.     HelpNewMenu[10].nm_Label  = (STRPTR)getString(Credits_Line5_STRING);
  197. }
  198.  
  199. UWORD HelpGTypes[] = {
  200.     BUTTON_KIND,
  201.     BUTTON_KIND,
  202.     CHECKBOX_KIND,
  203.     CHECKBOX_KIND,
  204.     CHECKBOX_KIND,
  205.     CHECKBOX_KIND,
  206.     CHECKBOX_KIND,
  207.     CHECKBOX_KIND,
  208.     CHECKBOX_KIND,
  209.     CHECKBOX_KIND,
  210.     CHECKBOX_KIND,
  211.     BUTTON_KIND,
  212.     BUTTON_KIND,
  213.     STRING_KIND,
  214.     STRING_KIND,
  215.     STRING_KIND,
  216.     STRING_KIND,
  217.     INTEGER_KIND,
  218.     INTEGER_KIND,
  219.     CHECKBOX_KIND,
  220.     CHECKBOX_KIND,
  221. };
  222.  
  223. UWORD HotKeyGTypes[] = {
  224.     LISTVIEW_KIND,
  225.     LISTVIEW_KIND,
  226.     STRING_KIND,
  227.     STRING_KIND,
  228.     CYCLE_KIND,
  229.     BUTTON_KIND,
  230.     BUTTON_KIND,
  231.     BUTTON_KIND
  232. };
  233.  
  234. UWORD MiscGTypes[] = {
  235.     CYCLE_KIND,
  236.     INTEGER_KIND,
  237.     INTEGER_KIND,
  238.     BUTTON_KIND
  239. };
  240.  
  241. struct NewGadget HelpNGad[] = {
  242.     450, 161, 89, 18, NULL, NULL, GD_Hide, PLACETEXT_IN, NULL, NULL,
  243.     542, 161, 86, 18, NULL, NULL, GD_Quit, PLACETEXT_IN, NULL, NULL,
  244.     12, 30, 26, 11, NULL, NULL, GD_AutoCheck, PLACETEXT_RIGHT, NULL, NULL,
  245.     12, 52, 26, 11, NULL, NULL, GD_KeyActCheck, PLACETEXT_RIGHT, NULL, NULL,
  246.     12, 63, 26, 11, NULL, NULL, GD_CTFCheck, PLACETEXT_RIGHT, NULL, NULL,
  247.     12, 74, 26, 11, NULL, NULL, GD_CTBCheck, PLACETEXT_RIGHT, NULL, NULL,
  248.     213, 42, 26, 11, NULL, NULL, GD_ScrCycleCheck, PLACETEXT_RIGHT, NULL, NULL,
  249.     213, 64, 26, 11, NULL, NULL, GD_WildStarCheck, PLACETEXT_RIGHT, NULL, NULL,
  250.     213, 53, 26, 11, NULL, NULL, GD_ScrActCheck, PLACETEXT_RIGHT, NULL, NULL,
  251.     12, 41, 26, 11, NULL, NULL, GD_AutoPopCheck, PLACETEXT_RIGHT, NULL, NULL,
  252.     213, 31, 26, 11, NULL, NUL